package cn.young.javalearning.designpattern.proxypattern.dynamicProxy.jkdproxy;

import cn.young.javalearning.designpattern.proxypattern.GuKe;
import cn.young.javalearning.designpattern.proxypattern.Shopping;

/**
 * 外卖小哥
 */
public class Main {
    public static void main(String[] args) {

        Shopping getinstance = (Shopping) new WanNengDiWaiMaiXiaoGe().getinstance(new GuKe());
        getinstance.shopping();

        WanNeng getinstance1 = (WanNeng) new WanNengDiWaiMaiXiaoGe().getinstance((WanNeng) () -> System.out.println("做任何想做的又不愿意自己做的事。"));
        getinstance1.doAnyThing();
    }
}
